package com.crusinnovation.unitTest.comparator;

import junit.framework.JUnit4TestAdapter;

import org.junit.Test;

import com.cyrusinnovation.test.comparator.FemaleB4MaleLastNameAscending;
import com.cyrusinnovation.test.record.Gender;
import com.cyrusinnovation.test.record.PersonRecord;

public class FemaleB4MaleLastNameAscendingTest  extends RecordComparatorTestRunner {
	@Test
	public void testCompare() {
		PersonRecord r1 = new PersonRecord();
		PersonRecord r2 = new PersonRecord();
		setComparator(new FemaleB4MaleLastNameAscending());

		r1.setLastName("A");
		r1.setGender(Gender.MALE);
		r2.setLastName("B");
		r2.setGender(Gender.FEMALE);
		runCompareToTest(r2, r1, "Female<Male ignore last name");

		r2.setGender(Gender.MALE);
		runCompareToTest(r1, r2, "Male=Male, A<B");
	}
	
	public static junit.framework.Test suite() { 
	    return new JUnit4TestAdapter(FemaleB4MaleLastNameAscendingTest.class); 
	}
}
